<!DOCTYPE html>
<html lang="en" ng-app="app">
<head>
	<meta charset="UTF-8">
	<title>Document</title>
</head>
<body>
	<div ng-controller="Ctrl">
		Ctrl:
		<br>
		<input type="text" ng-model="ctrlFlavor">
		<br>
		Directive:
		<br>
		<drink flavor="ctrlFlavor"></drink>
	</div>

	<script src="angular.js"></script>
	<script type="text/javascript">
		var module = angular.module("app", []);

		module.controller("Ctrl", function($scope) {
			$scope.ctrlFlavor = "百威";
		});

		module.directive("drink", function() {
			return {
				restrict: "E",
				template: "<input type='text' ng-model='flavor'>",
				scope: {
					flavor: "="
				}
			}
		});


	</script>
</body>
</html>